package io.renren.common.utils;

import cn.hutool.crypto.symmetric.AES;
import io.renren.modules.thirdpartyverification.controller.constant.VerificationConstant;

/**
 * @Author：T-weiwei
 * @Description: AES加密工具类
 * @Email：tweiwei@aliyun.com
 * @CreateDate：2022-01-11-上午11:14
 * @CopyRight：http://www.huaxun.ink/
 * @Hint： This content is limited to the internal circulation of HuaXun Hi Tech Co., Ltd.,
 * and is forbidden to be leaked and used for other commercial purposes
 **/
public class AesUtil {

    private static AES aes;

    private AesUtil(){}

    public static synchronized AES getInstance(){
        if (aes == null) {
            aes = new AES(VerificationConstant.MODEL, VerificationConstant.COMPLEMENT_WAY,
                    VerificationConstant.SECRET_KEY.getBytes(), VerificationConstant.SALT.getBytes());
        }
        return aes;
    }

}
